﻿<UserControl x:Class="Mari.SmartHotel.Controls.MainPaneEmpty"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:sh="clr-namespace:Mari.SmartHotel.Controls.Converters"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="Transparent" x:Name="usrClock" MinWidth="250" MinHeight="250" IsVisibleChanged="usrClock_IsVisibleChanged">
    <Canvas>
        <Canvas.Resources>
            <sh:DivideConverter x:Key="divideConverter" />
        </Canvas.Resources>

        <!-- Hour  -->
        <Border Canvas.Left="{Binding ElementName=usrClock, Path=ActualWidth, Converter={StaticResource divideConverter}, ConverterParameter=2}"
            Canvas.Bottom="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2}"
            Height="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=3}" 
            Name="borderHour" 
            BorderThickness="0.5" Width="3" Margin="-1.5,0,0,0" CornerRadius="1.5">
            <Border.BorderBrush>
                <SolidColorBrush Color="Black" Opacity="0.5" />
            </Border.BorderBrush>
            <Border.RenderTransform>
                <RotateTransform x:Name="hourHand" CenterX="1.5" 
                CenterY="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=3}" Angle="0" />
            </Border.RenderTransform>
        </Border>
        <!---->
        
        <!-- Minute  -->
        <Border Canvas.Left="{Binding ElementName=usrClock, Path=ActualWidth, Converter={StaticResource divideConverter}, ConverterParameter=2}"  
            Canvas.Bottom="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2}"
            Height="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2\,3}" 
            Name="borderMinute" 
            BorderThickness="0.5" Width="3" Margin="-1.5,0,0,0" CornerRadius="1.5">
            <Border.RenderTransform>
                <RotateTransform x:Name="minuteHand" CenterX="1.5" 
                CenterY="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2\,3}"
                Angle="0" />
            </Border.RenderTransform>
            <Border.BorderBrush>
                <SolidColorBrush Color="Black" Opacity="0.5" />
            </Border.BorderBrush>
        </Border>
        <!---->
        
        <!-- Second  -->
        <Border Canvas.Left="{Binding ElementName=usrClock, Path=ActualWidth, Converter={StaticResource divideConverter}, ConverterParameter=2}"
                Canvas.Bottom="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2}"
                   Name="borderSecond" CornerRadius="0.75"
                   Height="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2\,1}" 
                   VerticalAlignment="Bottom" BorderThickness="0.5" Width="1.5" Margin="-0.75,0,0,0">
            <Border.RenderTransform>
                <RotateTransform x:Name="secondHand" CenterX="0.75" 
                CenterY="{Binding ElementName=usrClock, Path=ActualHeight, Converter={StaticResource divideConverter}, ConverterParameter=2\,1}" 
                                 Angle="0" />
            </Border.RenderTransform>
            <Border.BorderBrush>
                <SolidColorBrush Color="Black" Opacity="0.5" />
            </Border.BorderBrush>
        </Border>
        <!---->
     </Canvas>
</UserControl>
